package com.yanggu.mapreduce.customizeoutputformat;

import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

import java.io.IOException;

/**
 * @version V1.0
 * @author: YangGu
 * @date: 2020/2/7 21:59
 * @description:
 */
public class FilterMapper extends Mapper<LongWritable, Text, Text, NullWritable> {

    Text k = new Text();

    @Override
    protected void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException {
        k.set(value.toString().concat("\r\n"));
        context.write(k, NullWritable.get());
    }
}
